//
//  MMGSocketClient.h
//  MyApp
//
//  Created by Don on 2017/8/28.
//  Copyright © 2017年 com.memego. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MMGConstSocketMsgType.h"


static NSString *const kMMG_Notification_SocketDidOpen              = @"com.memego.prizeclaw.notification_socket_did_open";
static NSString *const kMMG_Notification_SocketDidFailWithError     = @"com.memego.prizeclaw.notification_socket_did_fail";
static NSString *const kMMG_Notification_SocketDidClose             = @"com.memego.prizeclaw.notification_socket_did_close";
static NSString *const kMMG_Notification_SocketDidReceiveMsg        = @"com.memego.prizeclaw.notification_socket_did_receive";
static NSString *const kMMG_Notification_SocketHeartOutTime         = @"com.memego.prizeclaw.notification_socket_heartbeat_timeout";

@interface MMGSocketClient : NSObject
@property (nonatomic, assign) NSTimeInterval syncTimestampDifference;
@property (nonatomic, strong) NSMutableArray *sendingDataBuffer;


+ (instancetype)shareMMGSocketClient;

- (void)connectServerHost:(NSString *)host port:(uint16_t)port;
- (void)closeSocket;
- (BOOL)socketIsConnected;
- (void)sendMessage:(NSData *)msg;



@end
